package com.finance.system.dao;

import com.finance.framework.lang.Page;
import com.finance.rule.bean.pojo.MajorRule;
import com.finance.system.bean.pojo.Supplier;
import com.finance.system.bean.pojo.SupplierGroup;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Created by gly on 2017/4/1.
 */
@Component
public interface SupplierMapper {

    List<Supplier> listByPage(Page page);

    Supplier getById(Long id);

    int add(Supplier supplier);

    int update(Supplier supplier);

    int delete(@Param("uId") Long uId, @Param("ids") List<String> id);

    List<Supplier> listAll();

    List<Map<String, String>> listGroups();

    String getGroupIdByName(String name);

    MajorRule getRuleByName(String name);

    int addGroup(SupplierGroup supplierGroup);

    Supplier getByCode(String code);

    int codeIsExist(String code);

    int groupCodeIsExist(String code);

    int addRule(MajorRule majorRule);

    MajorRule getRuleById(String id);

    int updateRule(MajorRule majorRule);

    String getCodeByName(@Param("name") String Name);

    String getNameByCode(@Param("code") String supplierCode);
}
